package com.mmp.main.servlet.validation;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.mmp.common.servlet.BasicServlet;
import com.mmp.main.entity.JobOrder;
import com.mmp.main.util.WebUtil;

public class CheckJobOrderNoDuplication extends BasicServlet {

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException,
			IOException {

		int siteId = getSessionSiteId(request);
		String jobOrderNo = WebUtil.getParamValue(request, "jobOrderNo", null);

		JobOrder jobOrder = dbQueryManager.checkJobOrderNoDuplication(siteId, jobOrderNo);

		PrintWriter out = response.getWriter();
		if (jobOrder == null) {
			out.print("true");
			return;
		}

		out.print("false");
	}

}
